package com.fg.cloud.manager.service.order.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fg.cloud.manager.entry.BaseEntity;
import com.fg.cloud.manager.entry.order.OrderCheckEntity;
import com.fg.cloud.manager.mapper.BaseMapper;
import com.fg.cloud.manager.mapper.order.OrderCheckMapper;
import com.fg.cloud.manager.service.BaseServiceImpl;
import com.fg.cloud.manager.service.order.OrderCheckService;

/**
 * @author ：
 * @date ： 2017年6月23日 下午2:14:24
 * @Desc ：订单记录
 */
@Service
public class OrderCheckServiceImpl extends BaseServiceImpl implements OrderCheckService {
	@Autowired
	private OrderCheckMapper orderCheckMapper;

	@Override
	protected <T extends BaseEntity> BaseMapper getBaseMapper() {
		return orderCheckMapper;
	}

	//根据订单id删除订单审核流程信息
	@Override
	public int deleteByOrderId(long orderId) {
		int temp = orderCheckMapper.deleteByOrderId(orderId);
		return temp;
	}

	@Override
	public List<OrderCheckEntity> selectByOrderId(Long orderId) {
		return orderCheckMapper.selectByOrderId(orderId);
	}

	@Override
	public boolean delByFacId(Long facId) {		
		return orderCheckMapper.deleteByFacId(facId) > 0 ? true : false;
	}
}
